package com.zoe.vhr.utils;

import com.zoe.vhr.enums.MailConfigEnum;
import org.springframework.amqp.core.MessagePostProcessor;
import org.springframework.amqp.core.MessageProperties;

/**
 * @author zoe.Zhang
 * @date 2023/01/05
 * @description
 */
public class RabbitUtil {
    public static MessagePostProcessor customMsgId(String msgId) {
        return message -> {
            MessageProperties messageProperties = message.getMessageProperties();
            messageProperties.setHeader(MailConfigEnum.CONSUMER_MSG_ID, msgId);
            messageProperties.setCorrelationId(msgId);
            return message;
        };
    }
}
